<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

	protected function _initConfig()
	{
        /**
         * @todo In the future, create some files cache the data from database,
         * make the system more effictively,and this segment will be larger and
         * more complicated
         */ 
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/config.ini');
        return $config;
	}

    protected function _initCustomErrorHandler()
    {
		$this->bootstrap('FrontController');
        $front = $this->getResource('FrontController');
		if ($front->hasPlugin('Zend/Controller/Plugin/ErrorHandler.php')) {
			$front->unregisterPlugin('Zend/Controller/Plugin/ErrorHandler.php');	
		}
		$errorHandler = new Zend_Controller_Plugin_ErrorHandler();
		$errorHandler->setErrorHandler(array('controller'=>'system',
											 'action'=>'error'));
		$front->registerPlugin($errorHandler, 100);
    }
}

